#ifndef _MEDIA_SINK_HH
#include "MediaSink.hh"
#endif
#include "UserType.h"

class IPCameraAudioSink: public MediaSink {
public:
  static IPCameraAudioSink* createNew(UsageEnvironment& env, unsigned bufferSize = 20000);
  // "bufferSize" should be at least as large as the largest expected
  //   input frame.

protected:
  IPCameraAudioSink(UsageEnvironment& env, unsigned bufferSize);
      // called only by createNew()
  IPCameraAudioSink();
  ~IPCameraAudioSink();

protected:
  static void afterGettingFrame(void* clientData, unsigned frameSize,
				unsigned numTruncatedBytes,
				struct timeval presentationTime,
				unsigned durationInMicroseconds);
  virtual void afterGettingFrame1(unsigned frameSize,
				  struct timeval presentationTime);

  unsigned char* fBuffer;
  unsigned fBufferSize;

private: // redefined virtual functions:
  virtual Boolean continuePlaying();

};

